﻿ 
using System;
using System.Collections.Generic;
using CarTrackr.Business;

namespace CarTrackr.Tests.Repository
{
    public class DataStore
    {
        public List<User> Users
        {
            get;
            private set;
        }



        public List<Car> Cars
        {
            get;
            private set;
        }



        public List<Refuelling> Refuellings
        {
            get;
            private set;
        }


        public DataStore()
        {
            Users = new List<User>();

            Cars = new List<Car>();

            Refuellings = new List<Refuelling>();


            User user = new User
                            {
                                Email = "daniel_meng@hotmail.com",
                                Password = "1197344",
                                UserName = "daniel zhou",
                                UserId = Guid.NewGuid()
                            };

            Car car1 = new Car
                           {
                               LicensePlate = "ENN781",
                               FuelType = "Gas",
                               Id = Guid.NewGuid(),
                               Make = "Ford",
                               Model = "Explorer",
                               PurchasePrice = 26721
                           };


            Car car2 = new Car
            {
                LicensePlate = "ENN782",
                FuelType = "Gas",
                Id = Guid.NewGuid(),
                Make = "Honda",
                Model = "Civic",
                PurchasePrice = 12400
            };

            var refuelling1 = new Refuelling { Id = Guid.NewGuid(), Date = DateTime.Now, ServiceStation = "Huskey", Kilometers = 1000, Liters = 120, PricePerLiter = (decimal)0.91 };
            var refuelling2 = new Refuelling { Id = Guid.NewGuid(), Date = DateTime.Now, ServiceStation = "PetroCanada", Kilometers = 500, Liters = 67, PricePerLiter = (decimal)0.92 };
            var refuelling3 = new Refuelling { Id = Guid.NewGuid(), Date = DateTime.Now, ServiceStation = "Shell", Kilometers = 531, Liters = 69, PricePerLiter = (decimal)0.89 };


            car1.AddRefuelling(refuelling1);
            car1.AddRefuelling(refuelling2);
            car2.AddRefuelling(refuelling3);


            user.AddCar(car1);
            user.AddCar(car2);


            Users.Add(user);

            Cars.Add(car1);
            Cars.Add(car2);

            Refuellings.Add(refuelling1);
            Refuellings.Add(refuelling2);
            Refuellings.Add(refuelling3);



        }

    }
}
